package blazingbubble.gui.elements;



import java.awt.Font;
import java.awt.FontFormatException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import javax.swing.JLabel;

import blazingbubble.gui.Resources;


public class MenuLabel extends JLabel {
	private static final long serialVersionUID = 8081806636860252106L;
	
	public MenuLabel(String labelText, int fontStyle, float fontSize){
		super(labelText);
		this.setOpaque(false);
		Font font = null;
		FileInputStream inputStream = null;

		try {
			inputStream = new FileInputStream(new File((Resources.CRAYON_FONT_PATH)));
			font = (Font.createFont(Font.TRUETYPE_FONT, inputStream).deriveFont(fontStyle, fontSize));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (FontFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		finally {
			if (inputStream != null){
				try {
					inputStream.close();
				}
				catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		this.setFont(font);
	}

}
